<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>DOM案例</title>
</head>
<body>
    <img src="../resource/daolu1.jpeg" alt="" height="300px"> <br>
    <div id = 'div1'>你好前端</div> <br>
    <div id = 'div2'>Hello html</div> <br>
    <label for=""><input type="checkbox" name = "hobby">足球</label>
    <input type="checkbox" name = "hobby">篮球
    <input type="checkbox" name = "hobby">排球
    <img src="../resource/news_logo.png" alt="" height="300px"> <br>

</body>
<script>
    var img1 = document.getElementsByTagName("img")
    alert(img1)
    img1[0].src = "../resource/news_logo.png"

    var idd = document.getElementById("div1")
    idd.innerHTML = "hello"
    var idd2 = document.getElementById("div2")
    idd2.innerHTML = "<font color = 'red'>vetr"
    var six = document.getElementsByName("hobby");
    for(let i =0;i<six.length;i++){
        six[i].checked = true
    }
</script>
</html>